

const { ccclass, property } = cc._decorator;

@ccclass
export default class GameSelectManagerblock extends cc.Component {

    // LIFE-CYCLE CALLBACKS:
    @property(cc.SpriteFrame)
    cubebacespr: cc.SpriteFrame = null;

    @property(cc.SpriteFrame)
    ref: cc.SpriteFrame = null;

    onLoad() {
        let lout = this.node.addComponent(cc.Layout);
        for (var k = 0; k < 3; k++) {//只有3个ring
            let ringtemp = new cc.Node();
            if (cc.isValid(ringtemp)) {
                ringtemp.setContentSize(310, 310);
                let spraaa = ringtemp.addComponent(cc.Sprite);
                spraaa.type = cc.Sprite.Type.SLICED;
                spraaa.sizeMode = cc.Sprite.SizeMode.CUSTOM;
                spraaa.spriteFrame = this.cubebacespr;
                this.node.addChild(ringtemp);
            }
        }

        if (cc.isValid(lout)) {
            lout.type = cc.Layout.Type.HORIZONTAL;
            lout.paddingLeft = 30;
            lout.spacingX = 20;
        }
        lout.updateLayout();
        lout.enabled = false;
        this.node.children[0].active = false;
        // for (var k = 0; k < 3; k++) {//只有3个ring
        //     let ringtemp = new cc.Node();
        //     if (cc.isValid(ringtemp)) {
        //         ringtemp.setContentSize(62, 62);
        //         let spraaa = ringtemp.addComponent(cc.Sprite);
        //         spraaa.type = cc.Sprite.Type.SLICED;
        //         spraaa.sizeMode = cc.Sprite.SizeMode.CUSTOM;
        //         spraaa.spriteFrame = this.ref;
        //         this.node.addChild(ringtemp);
        //         ringtemp.setPosition(this.node.children[k].getPosition().x, this.node.children[k].getPosition().y + 120);

        //         let btn = ringtemp.addComponent(cc.Button);
        //         let clickEventtemp = new cc.Component.EventHandler();
        //         clickEventtemp.component = "GameSelectManagerbackcube";
        //         clickEventtemp.target = this.node;
        //         clickEventtemp.handler = "clickBtn";
        //         clickEventtemp.customEventData = k.toString();
        //         btn.clickEvents.push(clickEventtemp);
        //     }
        // }
    }

    start() {

    }

    //按钮点击事件
    clickBtn(event, data) {
        //GameCtr.ShowrefeshSelectCubesOncebyONclickedCtr(data);
    }

    update() {

    }
}
